<?
include('controller/connect.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="images/fav.ico">
<link rel="icon" type="image/gif" href="images/fav.ico">
<title>Login | <? dbClass::titlePage(); ?> </title>

<script type="text/javascript">

// This function checks if the emailusername field
// is at least 6 characters long.
// If so, it attaches class="welldone" to the 
// containing fieldset.

function checkemailusernameForLength(whatYouTyped) {
	var fieldset = whatYouTyped.parentNode;
	var txt = whatYouTyped.value;
	if (txt.length > 5) {
		fieldset.className = "welldone";
	}
	else {
		fieldset.className = "";
	}
}





// If the password is at least 4 characters long, the containing 
// fieldset is assigned class="kindagood".
// If it's at least 8 characters long, the containing
// fieldset is assigned class="welldone", to give the user
// the indication that they've selected a harder-to-crack
// password.

function checkPassword(whatYouTyped) {
	var fieldset = whatYouTyped.parentNode;
	var txt = whatYouTyped.value;
	if (txt.length > 3 && txt.length < 8) {
		fieldset.className = "kindagood";
	} else if (txt.length > 7) {
		fieldset.className = "welldone";
	} else {
		fieldset.className = "";
	}
}

// This function checks the email address to be sure
// it follows a certain pattern:
// blah@blah.blah
// If so, it assigns class="welldone" to the containing
// fieldset.

function checkEmail(whatYouTyped) {
	var fieldset = whatYouTyped.parentNode;
	var txt = whatYouTyped.value;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) {
		fieldset.className = "welldone";
	} else {
		fieldset.className = "";
	}
}




// this part is for the form field hints to display
// only on the condition that the text input has focus.
// otherwise, it stays hidden.

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}


function prepareInputsForHints() {
  var inputs = document.getElementsByTagName("input");
  for (var i=0; i<inputs.length; i++){
    inputs[i].onfocus = function () {
      this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
    }
    inputs[i].onblur = function () {
      this.parentNode.getElementsByTagName("span")[0].style.display = "none";
    }
  }
}
addLoadEvent(prepareInputsForHints);

</script>

	<link rel="stylesheet" href="css/style2.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="css/front.css" type="text/css" charset="utf-8" />
   <link rel="stylesheet" type="text/css" href="css/base/login_r.css"/>
</head>
<body>

<!-- Another f**kn LOgin-->

  <fieldset id="signin_menu">
    <form method="post" id="login" action="view/main.php">
      <label for="username">Username or email</label>
      <input id="emailusername" name="emailusername" value="" title="emailusername" tabindex="4" type="text">
      </p>
      <p>
        <label for="password">Password</label>
        <input id="password" name="password" value="" title="password" tabindex="5" type="password">
      </p>
      <p class="remember">
        <input id="signin_submit" value="Login" tabindex="6" type="submit">
        <input id="remember" name="remember_me" value="1" tabindex="7" type="checkbox">
        <label for="remember">Remember me</label>
      </p>
      <p class="forgot"> <a href="#" id="resend_password_link">Forgot your password?</a> </p>
      <p class="forgot-username"> <A id=forgot_username_link 
title="If you remember your password, try logging in with your email" 
href="#">Forgot your username?</A> </p>
    </form>
  </fieldset>
</div>

<div id="page">
<div id="wrapper">
        		   <div class="header_top" id="header_top"> </div>
  </div>
  <div class="header2"></div> 
	<div class="header"><!--open logo -->
		  </div><!--end header -->
	<!-- close logo-->
<!-- hide the client inquiries php-->
    <?php
    echo '<div id="nav">';
    echo '<div class="underlinemenu">';
	include('view/menu.php');
	echo '</div>';
    echo '</div>';
	?>
   
        <div id="body"> <center><!--open body --><!--close left --><!--close right-->
       <div id="content_center">
       <div id="login_che">
    <h2>Login </h2>
      <form action="view/main.php" name="login" method="post">
<fieldset>
	<label for="emailusername">Choose a emailusername:</label>
	<input name="emailusername"
		type="text"
		id="emailusername"
		onkeyup="checkemailusernameForLength(this);" />
	<span class="hint">Email or Username must be a least 6 characters in length.</span>
</fieldset>

<fieldset>
	<label for="password">Enter a password:</label>
	<input name="password"
		type="password"
		id="password"
		onkeyup="checkPassword(this);" />
	<span class="hint">The password can be any combination of characters, and must be at least 4 characters in length.  8 characters recommended!</span>
</fieldset>

          <input id="signin_submit" value="Login" tabindex="6" type="submit">


</form>

       </div>
       </center>
       </div>
      <div class="clear">&nbsp;</div>
 <!-- footer-->
 <?php 
	  echo '<div id="footer">';
     include('view/footer.php');
      echo '</div>';
	  ?>

  </div><!-- close body-->
</div><!-- close page-->



</body>
</html>

<!--JAVASCRIPT PART-->
<script src="javascripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
        $(document).ready(function() {

            $(".signin").click(function(e) {          
				e.preventDefault();
                $("fieldset#signin_menu").toggle();
				$(".signin").toggleClass("menu-open");
            });
			
			$("fieldset#signin_menu").mouseup(function() {
				return false
			});
			$(document).mouseup(function(e) {
				if($(e.target).parent("a.signin").length==0) {
					$(".signin").removeClass("menu-open");
					$("fieldset#signin_menu").hide();
				}
			});			
			
        });
</script>
<script src="javascripts/jquery.tipsy.js" type="text/javascript"></script>
<script type='text/javascript'>
    $(function() {
	  $('#forgot_username_link').tipsy({gravity: 'w'});   
    });
  </script>

	


	

